//数据格式注册——斗地主
module RegDataDdz {

    export let GAME_PLAYER = 3                                  //游戏人数
    export let MAX_COUNT = 20									//最大数目
    export let FULL_COUNT = 54									//全牌数目
    export let NORMAL_COUNT = 17									//常规数目

    // export let DISPATCH_COUNT = 51									//派发数目
    // export let GOOD_CARD_COUTN = 38									//好牌数目

    // export let MASK_COLOR = 0xF0								//花色掩码
    // export let MASK_VALUE = 0x0F								//数值掩码
    // export let CT_ERROR = 0									//错误类型
    // export let CT_SINGLE = 1									//单牌类型
    // export let CT_DOUBLE = 2									//对牌类型
    // export let CT_SINGLE_LINE = 3									//单连类型
    // export let CT_DOUBLE_LINE = 4									//对连类型
    // export let CT_THREE_LINE = 5									//三连类型
    // export let CT_THREE = 6									//三条类型
    // export let CT_THREE_TAKE_TWO = 7									//三带一对
    // export let CT_THREE_TAKE_ONE = 8									//三带一单
    // export let CT_FOUR_TAKE_ONE = 9									//四带两单
    // export let CT_FOUR_TAKE_TWO = 10									//四带两对
    // export let CT_BOMB_CARD = 11									//炸弹类型
    // export let CT_MISSILE_CARD = 12									//火箭类型
    // export let CT_THREE_LINE_ONE = 13                                  //三连带单
    // export let CT_THREE_LINE_TWO = 14                                  //三连带对

    // export let VALUE_SINGLE = 1                                   //单牌
    // export let VALUE_DOUBLE = 2                                   //对子
    // export let VALUE_THREE = 3                                   //三带
    // export let VALUE_SINGLE_LINE = 4                                   //顺子
    // export let VALUE_DOUBLE_LINE = 5                                   //连对
    // export let VALUE_THREE_LINE = 6                                   //飞机
    // export let VALUE_BOMB = 7                                   //炸弹

    // export let GAME_SCENE_FREE = 0					//等待开始
    // export let GAME_SCENE_CALL = 100					//叫分状态
    // export let GAME_SCENE_DOUBLE = 101					//加倍状态
    // export let GAME_SCENE_PLAY = 102					//游戏进行

    export let TCP_Command = {
        wMainCmdID: 3,
        wSubCmdID: 1,
        nLenght: 1,
        data: [

        ]
    }
    export let CMD_GR_ChairUserInfoReq = {
        wMainCmdID: 3,
        wSubCmdID: 11,
        nLenght: 4,
        data: [
            "wTableID", "WORD",   //桌子号码
            "wChairID", "WORD"  //椅子位置
        ]
    }

    export let CMD_GP_UserQuickSitdown = {
        wMainCmdID: 3,
        wSubCmdID: 3,
        nLenght: 70,
        data: [
            ["wTableID", "WORD"],
            ["wChairID", "WORD"],
            ["szInsurePass", "TCHAR", 33],
        ]
    }
    // //用户加倍
    // export let CMD_GP_CallDouble = {
    //     wMainCmdID: 9,
    //     wSubCmdID: 5,
    //     nLenght: 1,
    //     data: [
    //         ["cbIsDouble", "BYTE"],   //是否加倍 1-加倍 0-不加倍
    //     ]

    // }


    //验证银行密码
    export let CMD_GP_VerifyInsurePass = {
        wMainCmdID: 9,
        wSubCmdID: 407,
        nLenght: 33,
        data: [
            ["szPassword", "TCHAR", 33],
        ]

    }

    //查询用户游戏积分
    export let CMD_GP_QueryGameSocre = {
        wMainCmdID: 9,
        wSubCmdID: 501,
        nLenght: 0,
        data: [

        ]
    }

    //开始游戏
    export let CMD_GP_StartGame = {
        wMainCmdID: 100,
        wSubCmdID: 1,
        nLenght: 9,
        data: [
            ["wVisit", "BYTE"],
            ["wVersion", "DWORD"],
            ["wGameVersion", "DWORD"]
        ]
    }
    export let CMD_GP_UserMate = {
        wMainCmdID: 100,
        wSubCmdID: 2,
        nLenght: 0,
        data: [
            
        ]
    }
    //用户叫分
    export let CMD_GP_CallSocre = {
        wMainCmdID: 200,
        wSubCmdID: 1,
        nLenght: 1,
        data: [
            ["cbCallScore", "BYTE"],    //叫分数目 不叫为255
        ]
    }
    //用户出牌
    export let CMD_GP_OutCard = {
        wMainCmdID: 200,
        wSubCmdID: 2,
        nLenght: 22,
        data: [
            ["cbCardCount", "BYTE"],   //出牌数目
            ["cbCardData", "BYTE[]", 0],   //扑克数据
        ]
    }
    //用户弃牌
    export let CMD_GP_PassCard = {
        wMainCmdID: 200,
        wSubCmdID: 3,
        nLenght: 0,
        data: [

        ]

    }
    //用户托管
    export let CMD_GP_Trustee = {
        wMainCmdID: 200,
        wSubCmdID: 4,
        nLenght: 1,
        data: [
            ["cbTrustee", "BYTE"],   //0:取消托管 1:托管
        ]
    }
    //空闲
    export let free = [
        ["lCellScore", "LONG"],        //基础积分
        ["cbTimeOutCard", "BYTE"],        //出牌时间
        ["cbTimeCallScore", "BYTE"],        //叫分时间
        ["cbTimeStartGame", "BYTE"],        //开始时间
        ["cbTimeHeadOutCard", "BYTE"],        //首出时间
        ["lTurnScore", "DLONG[]", GAME_PLAYER],        //积分信息
        ["lCollectScore", "DLONG[]", GAME_PLAYER],        //积分信息

    ];
    //游戏状态
    export let gameStart = [
        ["cbTimeOutCard", "BYTE"],        //出牌时间
        ["cbTimeCallScore", "BYTE"],        //叫分时间
        ["cbTimeStartGame", "BYTE"],        //开始时间
        ["cbTimeHeadOutCard", "BYTE"],        //首出时间

        ["lCellScore", "LONG"],        //单元积分
        ["cbBombCount", "BYTE"],        //炸弹次数
        ["wBankerUser", "WORD"],        //庄家用户
        ["wCurrentUser", "WORD"],        //当前玩家
        ["cbBankerScore", "BYTE"],        //当前玩家

        ["wTurnUser", "WORD"],        //出牌玩家
        ["cbTurnCardCount", "BYTE"],        //出牌数目
        ["cbTurnCardData", "BYTE[]", MAX_COUNT],        //出牌数据

        ["cbBankerCard", "BYTE[]", 3],        //游戏底牌
        ["cbHandCardData", "BYTE[]", MAX_COUNT],        //手上扑克
        ["cbHandCardCount", "BYTE[]", GAME_PLAYER],        //扑克数目
        ["cbOutCard", "BYTE[]", FULL_COUNT],        //出过的牌


        ["lTurnScore", "DLONG[]", GAME_PLAYER],        //积分信息
        ["lCollectScore", "DLONG[]", GAME_PLAYER],        //积分信息
        ["cbUserTrustee", "BYTE[]", GAME_PLAYER],        //托管标志
        ["cbCurrentTimer", "BYTE"],        //当前计时


    ];
    //叫分
    export let jiaofen = [
        ["cbTimeOutCard", "BYTE"],        //出牌时间
        ["cbTimeCallScore", "BYTE"],        //叫分时间
        ["cbTimeStartGame", "BYTE"],        //开始时间
        ["cbTimeHeadOutCard", "BYTE"],        //首出时间

        ["lCellScore", "LONG"],        //单元积分
        ["wCurrentUser", "WORD"],        //当前玩家
        ["cbBankerScore", "BYTE"],        //庄家叫分
        ["cbScoreInfo", "BYTE[]", GAME_PLAYER],        //叫分信息
        ["cbHandCardData", "BYTE[]", NORMAL_COUNT],        //手上扑克
        ["cbUserTrustee", "BYTE[]", GAME_PLAYER],        //托管标志
        ["lTurnScore", "DLONG[]", GAME_PLAYER],        //积分信息
        ["lCollectScore", "DLONG[]", GAME_PLAYER],        //积分信息
        ["cbCurrentTimer", "BYTE"],        //当前计时
    ]

    export let MainCMD_MsgId = {
        1: {
            //登陆成功
            100: [
                ["dwUserRight", "DWORD"],        //用户权限
                ["dwMasterRight", "DWORD"],       //管理权限
            ],
           //登陆失败
            101: [
                ["lErrorCode", "DWORD"],        //错误代码
                ["szDescribeString", "TCHARS", 128],       //描述
            ],
            //登陆完成
            102: [

            ],
            //登陆游戏时发现在其他房间
            103: [
                ["wServerID", "WORD"],        //其他游戏房间的serverID
            ],
            //重选服务器-选桌类型
            104: [

            ],
            //升级提示
            200: [
                ["cbMustUpdatePlaza", "BYTE"],        //强行升级
                ["cbMustUpdateClient", "BYTE"],       //强行升级
                ["cbAdviceUpdateClient", "BYTE"],        //建议升级
                ["dwCurrentPlazaVersion", "DWORD"],       //当前版本
                ["dwCurrentFrameVersion", "DWORD"],        //当前版本
                ["dwCurrentClientVersion", "DWORD"],       //当前版本
            ],
        },


        2: {
            //列表配置
            100: [
                ["cbColumnCount", "BYTE"],      //列表数目
                ["ColumnItem", "STRUCT[]", [
                    ["cbColumnWidth", "BYTE"],        //列表宽度
                    ["cbDataDescribe", "BYTE"],        //字段类型
                    ["szColumnName", "TCHAR", 16],       //列表名字
                ], 32],        //列表描述
            ],
            //房间配置
            101: [
                ["wTableCount", "WORD"],        //桌子数目
                ["wChairCount", "WORD"],        //椅子数目
                ["wServerType", "WORD"],        //房间类型
                ["dwServerRule", "DWORD"],        //房间规则
            ],
            //完成配置
            103: [

            ],
            //玩家权限
            104: [
                ["dwUserRight", "DWORD"],        //玩家权限
            ],
        },

        3: {
            //用户规则
            1: [
                ["cbRuleMask", "BYTE"],        //规则掩码
                ["wMinWinRate", "WORD"],        //最低胜率
                ["wMaxFleeRate", "WORD"],        //最高逃率
                ["lMaxGameScore", "LONG"],        //最高分数
                ["lMinGameScore", "LONG"],        //最低分数
            ],
            //旁观请求
            2: [

            ],

            //拒绝黑名单坐下
            7: [
                ["wTableID", "WORD"],        //桌子位置
                ["wChairID", "WORD"],        //椅子位置
                ["dwUserID", "DWORD"],        //用户ID
                ["dwRepulseUserID", "DWORD"]        //用户ID
            ],
            //提出用户
            8: [
                ["dwTargetUserID", "DWORD"],        //用户标识
            ],
            //用户进入
            100: [
                ["tagMobileUserInfoHead", "SPSTRUCT", [
                    ["dwGameID", "DWORD"],        //游戏 I D
                    ["dwUserID", "DWORD"],        //用户 I D
                    ["dwGroupID", "DWORD"],        //社团 I D
                    ["wFaceID", "WORD"],        //头像索引
                    ["dwCustomID", "DWORD"],        ////自定标识
                    ["bIsAndroid", "BOOL"],        ////机器标识
                    ["cbGender", "BYTE"],        ////用户性别
                    ["cbMemberOrder", "BYTE"],        ////会员等级
                    ["cbTrader", "BYTE"],        ////管理等级
                    ["wTableID", "WORD"],        ////桌子索引
                    ["wChairID", "WORD"],        ////椅子索引
                    ["cbUserStatus", "BYTE"],        ////用户状态
                    ["lScore", "DLONG"],        ////用户分数  用户的money
                    ["lGrade", "DLONG"],        ////用户成绩
                    ["lInsure", "DLONG"],        ////用户银行
                    ["lIngot", "DLONG"],        ////用户元宝
                    ["dBeans", "DOUBLE"],        ////用户游戏豆
                    ["dwWinCount", "DWORD"],        //胜利盘数
                    ["dwLostCount", "DWORD"],        //失败盘数
                    ["dwDrawCount", "DWORD"],        //和局盘数
                    ["dwFleeCount", "DWORD"],        //逃跑盘数
                    ["dwExperience", "DWORD"],        //用户经验
                    ["lLoveLiness", "DWORD"],        //用户魅力
                    ["lIntegralCount", "DLONG"],        //积分总数
                    ["dwAgentID", "DWORD"],        //代理 I D
                ]]
            ],
            //用户分数
            101: [
                ["dwUserID", "DWORD"],        //桌子位置
                ["UserScore", "STRUCT", [
                    ["lScore", "DLONG"],        //用户分数
                    ["lGrade", "DLONG"],        //用户成绩
                    ["lInsure", "DLONG"],        //用户银行
                    ["lIngot", "DLONG"],        //用户元宝
                    ["dBeans", "DOUBLE"],        //用户游戏豆
                    ["dwWinCount", "DWORD"],        //胜利盘数
                    ["dwLostCount", "DWORD"],        //失败盘数
                    ["dwDrawCount", "DWORD"],        //和局盘数
                    ["dwFleeCount", "DWORD"],        //逃跑盘数
                    ["lIntegralCount", "DLONG"],        //积分总数(当前房间)
                    ["dwExperience", "DWORD"],        //用户经验
                    ["lLoveLiness", "LONG"]        //用户魅力
                ]],        //积分信息
            ],
            //用户状态
            102: [
                ["dwUserID", "DWORD"],        //用户标识
                ["UserStatus", "STRUCT", [
                    ["wTableID", "WORD"],        //桌子索引
                    ["wChairID", "WORD"],        //椅子位置
                    ["cbUserStatus", "BYTE"]        //用户状态
                ]],        //用户状态
            ],
            //请求失败
            103: [
                ["lErrorCode", "LONG"],        //错误码
                ["wServerType", "WORD"],        //错误码
                ["szDescribeString", "TCHARS", 256]        //描述信息
            ],
            //踢出用户
            104: [
                ["dwTargetUserID", "DWORD"],        //目标用户
            ],
        },

        4: {
            //桌子信息
            100: [
                ["wTableCount", "WORD"],        //桌子数量
                ["TableStatusArray", "STRUCT[]", [
                    ["cbTableLock", "BYTE"],     //锁定标志
                    ["cbPlayStatus", "BYTE"],       //游戏标志
                    ["lCellScore", "LONG"],       //单元积分
                ], 512] //桌子状态
            ],
            //桌子状态
            101: [
                ["wTableID", "WORD"],        //桌子号码
                ["TableStatus", "STRUCT", [
                    ["cbTableLock", "BYTE"],     //锁定标志
                    ["cbPlayStatus", "BYTE"],       //游戏标志
                    ["lCellScore", "LONG"],       //单元积分
                ]] //桌子状态
            ]
        },
        5: {
            //银行资料返回
            100: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["wRevenueTake", "WORD"],        //税收比列
                ["wRevenueTransfer", "WORD"],        //税收比列
                ["wServerID", "WORD"],        //房间标识
                ["lUserScore", "SCORE"],        //用户金币
                ["lUserInsure", "SCORE"],        //银行金币
                ["lTransferPrerequisite", "SCORE"],        //转账条件
            ],
            //银行操作成功
            101: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["lUserScore", "SCORE"],        //身上金币
                ["lUserInsure", "SCORE"],        //银行金币
                ["szDescribeString", "CHINESE", 128],        //描述消息
            ],
            //银行操作失败
            102: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["lErrorCode", "LONG"],        //错误代码
                ["szDescribeString", "CHINESE", 128],        //描述消息
            ],
        },
        100: {
            //游戏状态
            100: [
                ["cbGameStatus", "BYTE"],        //游戏状态
                ["cbAllowLookon", "BYTE"],        //旁观标志
            ],
            101: [],
            103: [],
            104: [],
            200: [
                ["wType", "WORD"],        //消息类型
                ["wLength", "WORD"],        //消息长度
                ["szString", "TCHARS", 1024],        //内容
            ],
            300: [
                ["szSerialNumber", "TCHARS", 32] //牌局编号
            ]
        },

        200: {
            //游戏开始
            100: [
                ["wStartUser", "WORD"],        //开始玩家
                ["wCurrentUser", "WORD"],        //当前玩家
                ["cbValidCardData", "BYTE"],        //明牌扑克
                ["cbValidCardIndex", "BYTE"],        //明牌位置
                ["cbCardData", "BYTE[]", 17],        //扑克列表
                // ["szUserArea", "BYTE[][]", 3, 32],        //用户地区
            ],
            //用户叫分
            101: [
                ["wCurrentUser", "WORD"],        //当前玩家
                ["wCallScoreUser", "WORD"],        //叫分玩家
                ["cbCurrentScore", "BYTE"],        //当前叫分
                ["cbUserCallScore", "BYTE"],        //上次叫分
            ],
            //确定庄家信息
            102: [
                ["wBankerUser", "WORD"],        //庄家玩具
                ["wCurrentUser", "WORD"],        //当前玩家
                ["cbBankerScore", "BYTE"],        //庄家叫分
                ["cbBankerCard", "BYTE[]", 3],        //庄家扑克
            ],
            //用户出牌
            103: [
                ["cbCardCount", "BYTE"],        //出牌数目
                ["wCurrentUser", "WORD"],        //当前玩家
                ["wOutCardUser", "WORD"],        //出牌玩家
                ["cbCardData", "BYTE[]", 0],        //扑克列表
            ],
            //用户弃牌
            104: [
                ["cbTurnOver", "BYTE"],        //一轮结束
                ["wCurrentUser", "WORD"],        //当前玩家
                ["wPassCardUser", "WORD"],        //放弃玩家
            ],
            //游戏结束
            105: [
                ["lCellScore", "LONG"],        //单元积分
                ["lGameScore", "DLONG[]", GAME_PLAYER],        //游戏积分

                ["bChunTian", "BYTE"],        //春天标志
                ["bFanChunTian", "BYTE"],        //春天标志

                ["cbBombCount", "BYTE"],        //炸弹个数
                ["cbEachBombCount", "BYTE[]", GAME_PLAYER], //炸弹个数
                ["cbBankerScore", "BYTE"],
                // ["cbGameEndFlag", "BYTE"],        //结束标志 0-正常结束 1-退出解散玩家
                ["cbCardCount", "BYTE[]", GAME_PLAYER],        //扑克数目
                ["cbHandCardData", "BYTE[]", FULL_COUNT],        //扑克列表
                // ["lUserScore", "WORD", GAME_PLAYER],        //用户剩余金币
            ],
            //设置基数
            106: [
                ["cbTurnOver", "BYTE"],        //一轮结束
                ["wCurrentUser", "WORD"],        //当前玩家
                ["wPassCardUser", "WORD"],        //放弃玩家
            ],
            //游戏空闲状态
            107: [
                ["lCellScore", "INT"],        //基础积分
                ["cbTimeOutCard", "BYTE"],        //出牌时间
                ["cbTimeCallScore", "BYTE"],        //叫分时间
            ],
            // //游戏叫分状态
            // 108: [
            //     ["cbTimeOutCard", "BYTE"],        //出牌时间
            //     ["cbTimeCallScore", "BYTE"],        //叫分时间
            //     ["bTimeLeftCallScore", "BYTE"],        //剩余时间
            //     ["lCellScore", "INT"],        //基础积分
            //     ["wCurrentUser", "WORD"],        //当前玩家
            //     ["cbBankerScore", "BYTE"],        //庄家叫分
            //     ["cbScoreInfo", "BYTE[]", GAME_PLAYER],        //叫分信息
            //     ["cbHandCardData", "BYTE[]", NORMAL_COUNT],        //手上扑克
            //     ["cbUserTrustee", "BYTE[]", GAME_PLAYER],        //玩家托管 1-托管 0-未托管
            // ],
            //游戏状态

            //托管状态
            108: [
                ["cbChairID", "WORD"],        //椅子号
                ["cbTrustee", "BYTE"],        //0取消托管   1托管 
            ],
            //用户加倍
            111: [
                ["wCurrentUser", "WORD"],        //当前玩家
                ["wCallDoubleUser", "WORD"],        //加倍玩家 
                ["cbIsDouble", "BYTE"],        //是否加倍 1是 0否
            ],
            //用户信息
            112: [
                ["szUserArea", "CHARSCHINESE[]", GAME_PLAYER, 32],        //用户地区
            ],
            //加倍完成
            113: [
                ["wBankerUser", "WORD"],        //庄家玩家
                ["wCurrentUser", "WORD"],        //当前玩家 
            ],
            //加倍状态
            114: [
                ["cbTimeOutCard", "BYTE"],        //出牌时间
                ["cbTimeCallScore", "BYTE"],        //叫分时间
                ["bTimeLeftCallScore", "BYTE"],        //剩余时间
                ["lCellScore", "INT"],        //基础积分
                ["wBankerUser", "WORD"],        //庄家用户
                ["cbBankerScore", "BYTE"],        //庄家叫分
                ["cbScoreInfo", "BYTE[]", GAME_PLAYER],        //叫分信息
                ["cbBankerCard", "BYTE[]", 3],        //游戏底牌
                ["cbHandCardData", "BYTE[]", MAX_COUNT],        //手上扑克
                ["cbHandCardCount", "BYTE[]", GAME_PLAYER],        //扑克数目
                ["cbDoubleInfo", "BYTE[]", GAME_PLAYER],        //加倍信息 未加倍为1，加倍为2 未确定是否加倍为255
                ["cbUserTrustee", "BYTE[]", GAME_PLAYER],        //玩家托管 1-托管 0-未托管
            ],
            115: [
                ["bIsDouble", "BYTE"],        //是否加倍 1-是 0-否
            ],

        },
        1000: {
            1: [
                ["wType", "WORD"],  //消息类型 1聊天消息 2弹出消息 4全局消息 8提示消息 16滚动消息
                ["wLength", "WORD"],  //消息长度
                ["szString", "TCHAR", 16],  //消息内容
            ],
        }

    }
    //I D 登录
    export let CMD_GP_LogonMobile = {
        wMainCmdID: 1,
        wSubCmdID: 1,
        nLenght: 216,
        data: [
            ["dwPlazaVersion", "DWORD"],                //dwPlazaVersion广场版本
            ["dwFrameVersion", "DWORD"],       //dwFrameVersion
            ["dwProcessVersion", "DWORD"], //dwProcessVersion
            ["dwUserID", "DWORD"],        //玩家id
            ["szPassword", "TCHAR", 33],        //动态密码
            ["szServerPasswd", "TCHAR", 33],        //szServerPasswd
            ["szMachineID", "TCHAR", 33],        //szMachineID
            ["wGameID", "WORD"],                //游戏id
        ]
    }

}
